<?php

use think\migration\Migrator;

class AddLastCheckinTimeToMember extends Migrator
{
    /**
     * 执行迁移
     */
    public function change()
    {
        // 为会员表添加最后签到时间字段
        $table = $this->table('checkin_member');
        $table->addColumn('last_checkin_time', 'datetime', [
            'null' => true, 
            'comment' => '最后签到时间',
            'after' => 'update_time'
        ])
        ->addIndex(['last_checkin_time'])
        ->update();
    }
}
